<div class="row justify-content-center">
    <div class="col-8">
        <form name="editForm" role="form" novalidate (ngSubmit)="save()" #editForm="ngForm">
            <h2 id="jhi-shop-info-heading" jhiTranslate="husenApp.shopInfo.home.createOrEditLabel">Create or edit a Shop Info</h2>
            <div>
                <jhi-alert-error></jhi-alert-error>
                <div class="form-group" [hidden]="!shopInfo.id">
                    <label for="id" jhiTranslate="global.field.id">ID</label>
                    <input type="text" class="form-control" id="id" name="id"
                        [(ngModel)]="shopInfo.id" readonly />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.sname" for="field_sname">Sname</label>
                    <input type="text" class="form-control" name="sname" id="field_sname"
                        [(ngModel)]="shopInfo.sname" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.gname" for="field_gname">Gname</label>
                    <input type="text" class="form-control" name="gname" id="field_gname"
                        [(ngModel)]="shopInfo.gname" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.gadds" for="field_gadds">Gadds</label>
                    <input type="text" class="form-control" name="gadds" id="field_gadds"
                        [(ngModel)]="shopInfo.gadds" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.homeType" for="field_homeType">Home Type</label>
                    <input type="number" class="form-control" name="homeType" id="field_homeType"
                        [(ngModel)]="shopInfo.homeType" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.carType" for="field_carType">Car Type</label>
                    <input type="number" class="form-control" name="carType" id="field_carType"
                        [(ngModel)]="shopInfo.carType" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.orderType" for="field_orderType">Order Type</label>
                    <input type="number" class="form-control" name="orderType" id="field_orderType"
                        [(ngModel)]="shopInfo.orderType" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.vipType" for="field_vipType">Vip Type</label>
                    <input type="number" class="form-control" name="vipType" id="field_vipType"
                        [(ngModel)]="shopInfo.vipType" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.vipSale" for="field_vipSale">Vip Sale</label>
                    <input type="number" class="form-control" name="vipSale" id="field_vipSale"
                        [(ngModel)]="shopInfo.vipSale" />
                </div>
                <div class="form-group" [hidden]="true">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.spic" for="field_spic">Spic</label>
                    <input type="text" class="form-control" name="spic" id="field_spic"
                        [(ngModel)]="shopInfo.spic" />
                </div>
                <div class="form-group" [hidden]="true">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.gpic" for="field_gpic">Gpic</label>
                    <input type="text" class="form-control" name="gpic" id="field_gpic"
                        [(ngModel)]="shopInfo.gpic" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.spicImg" for="field_spicImg">Spic Img</label>
                    <div>
                        <img [src]="'data:' + shopInfo.spicImgContentType + ';base64,' + shopInfo.spicImg" style="max-height: 100px;" *ngIf="shopInfo.spicImg" alt="shopInfo image"/>
                        <div *ngIf="shopInfo.spicImg" class="form-text text-danger clearfix">
                            <span class="pull-left">{{shopInfo.spicImgContentType}}, {{byteSize(shopInfo.spicImg)}}</span>
                            <button type="button" (click)="clearInputImage('spicImg', 'spicImgContentType', 'fileImage')" class="btn btn-secondary btn-xs pull-right">
                                <fa-icon [icon]="'times'"></fa-icon>
                            </button>
                        </div>
                        <input type="file" id="file_spicImg" (change)="setFileData($event, shopInfo, 'spicImg', true)" accept="image/*" jhiTranslate="entity.action.addimage"/>
                    </div>
                    <input type="hidden" class="form-control" name="spicImg" id="field_spicImg"
                        [(ngModel)]="shopInfo.spicImg" />
                    <input type="hidden" class="form-control" name="spicImgContentType" id="field_spicImgContentType"
                        [(ngModel)]="shopInfo.spicImgContentType" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.gpicImg" for="field_gpicImg">Gpic Img</label>
                    <div>
                        <img [src]="'data:' + shopInfo.gpicImgContentType + ';base64,' + shopInfo.gpicImg" style="max-height: 100px;" *ngIf="shopInfo.gpicImg" alt="shopInfo image"/>
                        <div *ngIf="shopInfo.gpicImg" class="form-text text-danger clearfix">
                            <span class="pull-left">{{shopInfo.gpicImgContentType}}, {{byteSize(shopInfo.gpicImg)}}</span>
                            <button type="button" (click)="clearInputImage('gpicImg', 'gpicImgContentType', 'fileImage')" class="btn btn-secondary btn-xs pull-right">
                                <fa-icon [icon]="'times'"></fa-icon>
                            </button>
                        </div>
                        <input type="file" id="file_gpicImg" (change)="setFileData($event, shopInfo, 'gpicImg', true)" accept="image/*" jhiTranslate="entity.action.addimage"/>
                    </div>
                    <input type="hidden" class="form-control" name="gpicImg" id="field_gpicImg"
                        [(ngModel)]="shopInfo.gpicImg" />
                    <input type="hidden" class="form-control" name="gpicImgContentType" id="field_gpicImgContentType"
                        [(ngModel)]="shopInfo.gpicImgContentType" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.searchTag" for="field_searchTag">Search Tag</label>
                    <input type="text" class="form-control" name="searchTag" id="field_searchTag"
                        [(ngModel)]="shopInfo.searchTag" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.carText" for="field_carText">Car Text</label>
                    <input type="text" class="form-control" name="carText" id="field_carText"
                        [(ngModel)]="shopInfo.carText" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.times" for="field_times">Times</label>
                    <input type="text" class="form-control" name="times" id="field_times"
                        [(ngModel)]="shopInfo.times" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.phone" for="field_phone">Phone</label>
                    <input type="text" class="form-control" name="phone" id="field_phone"
                        [(ngModel)]="shopInfo.phone" />
                </div>
                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.coupons" for="field_coupons">Coupons</label>
                    <input type="number" class="form-control" name="coupons" id="field_coupons"
                        [(ngModel)]="shopInfo.coupons" />
                </div>

                <div class="form-group">
                    <label class="form-control-label" jhiTranslate="husenApp.shopInfo.coupons1" for="field_coupons1">Coupons 1</label>
                    <select class="form-control" id="field_coupons1" name="coupons1" [(ngModel)]="shopInfo.coupons1Id">
                        <option [ngValue]="null"></option>
                        <option [ngValue]="couponsOption.id" *ngFor="let couponsOption of coupons1s; trackBy: trackCouponsById">{{couponsOption.id}}</option>
                    </select>
                </div>
            </div>
            <div>
                <button type="button" id="cancel-save" class="btn btn-secondary"  (click)="previousState()">
                    <fa-icon [icon]="'ban'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.cancel">Cancel</span>
                </button>
                <button type="submit" id="save-entity" [disabled]="editForm.form.invalid || isSaving" class="btn btn-primary">
                    <fa-icon [icon]="'save'"></fa-icon>&nbsp;<span jhiTranslate="entity.action.save">Save</span>
                </button>
            </div>
        </form>
    </div>
</div>
